/*
 * @Author: 陆成杰
 * @Date: 2022-07-03 14:24:02
 * @LastEditTime: 2022-07-03 15:30:24
 * @LastEditors: 陆成杰
 * @FilePath: /boe/src/axios/plan.ts
 * Copyright (c) ${now_year} by zucc-陆成杰, All Rights Reserved. 
 */
import { request } from "./request";
// 计划管理

export function createPlan(name:string,mode:string,startDate:string,endDate:string,playPeriods:any) {
  return request({
      url: '/plan/create',
      method: 'post',
      data:{
        name,
        mode,
        startDate,
        endDate,
        playPeriods,
        deviceIds: [29]
      }
  })
}

export function copyPlan(planId:any) {
  return request({
      url: '/plan/copy_plan',
      method: 'post',
      params:{
        planId
      }
  })
}

export function getPlanList(offset:any, count:any) {
    return request({
        url: '/plan/get_plan_list',
        method: 'get',
        params: {
          offset,
          count
        }
    })
}

export function checkPlanList(offset:any, count:any, name:any, state:string) {
  return request({
      url: '/plan/get_plan_list',
      method: 'get',
      params: {
        offset,
        count,
        name,
        state
      }
  })
}



export function getPlanDetail(planId:string) {
  return request({
      url: '/plan/get_plan_detail',
      method: 'get',
      params: {
        planId
      }
  })
}

export function getPlanBasic(planId:string) {
  return request({
      url: '/plan/get_plan',
      method: 'get',
      params: {
        planId
      }
  })
}

export function deletePlan(planId:any) {
  return request({
      url: '/plan/delete_plan',
      method: 'delete',
      params: {
        planId
      }
  })
}


export function putPlan(planId:any) {
  return request({
      url: '/plan/publish',
      method: 'put',
      params: {
        planId
      }
  })
}